Skip to content

Conversation

Harini-T
Copy link

This series does the following

  • Add RTC driver for Xilinx RTC, with alarm and calibration support.
  • Add the RTC node in zynqmp.dtsi to enable RTC support.
  • Add device tree support for RTC.
  • Enable alarm and calibration features in rtc_api test.

@michalsimek
Copy link
Contributor

Please fix that reported issue above.

Add device tree binding for Xilinx RTC controller.

The RTC ensures accurate timekeeping using either auxiliary (VCCAUX_PMC)
or battery (VCC_BATT) power. It includes calibration logic to adjust for
temperature and voltage variations, supporting long-term accuracy. The RTC
generates periodic second tick and alarm interrupts for use by system
processors.

It features a 32-bit seconds counter (supports up to 136 years), a 16-bit
tick counter and a 4-bit fractional counter for fine-grained calibration.

Signed-off-by: Balanakakamal V <[email protected]>
Signed-off-by: Harini T <[email protected]>
Add driver support for Xilinx RTC controller.

The supported features include:
 - Set and get time using Zephyr time conversion functions.
 - Configuring and handling alarms using interrupt-based callbacks.
 - Querying and updating alarm time and supported alarm fields.
 - Detecting alarm triggers and monitoring pending alarm status.
 - RTC calibration using coarse and fine offset adjustments.

Alarm and calibration features are conditionally compiled using the
CONFIG_RTC_ALARM and CONFIG_RTC_CALIBRATION options.

Signed-off-by: Balanakakamal V <[email protected]>
Signed-off-by: Harini T <[email protected]>
Add rtc0 node to zynqmp.dtsi to enable RTC support.
Introduce alarms-count parameter to support alarm test cases.
This parameter is added to the Device Tree so test cases can
read its value and use it during testing. The IP supports only
a single alarm count.

Signed-off-by: Balanakakamal V <[email protected]>
Signed-off-by: Harini T <[email protected]>
Add support for RTC in kv260_r5. Update kv260_r5_defconfig to enable
RTC alarm and calibration support in the rtc_api test.

Signed-off-by: Balanakakamal V <[email protected]>
Signed-off-by: Harini T <[email protected]>
Copy link

sonarqubecloud bot commented Oct 6, 2025

Copy link
Contributor

@bjarki-andreasen bjarki-andreasen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Counters, even low power ones, use the counter API. RTCs are not counters, they store time in broken down time. Instead, implement a counter driver for the counter, and a user may choose to use this wrapper https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/rtc/rtc_counter.c to expose it as an RTC device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants